package pub.rookie.filing;

import java.io.File;
import java.util.Stack;

public class Filing
{
	public Filing()
	{
		
	}
	

	public void traverse(String root)
	{
		File rootDir = new File(root);
		stack.add(rootDir);
		
		while (!stack.empty())
		{
			File dir = stack.pop();
			
			File[] files = dir.listFiles();
			if (files == null)
				continue;
			
			for (File file : files)
			{
				if (file.isDirectory())
					stack.add(file);
				
				queue.add(file); log("traverse file -> " + file);
//				h.sendEmptyMessage(0);
			}
		}
	}
	
	private Stack<File> stack = new Stack<File>();
}
